#!/usr/bin/env python


def options(opt):
	opt.add_option('--disable-g2dpango', action = 'store_true', default = False, help = 'disable G2D Pango plugin [default: enabled]')


def configure(conf):
	if conf.options.disable_g2dpango:
		return

	from waflib.Build import Logs
	if conf.env['WITH_PANGO'] and \
		conf.env['WITH_CAIRO'] and \
		conf.env['WITH_PANGOCAIRO']:
		Logs.pprint('GREEN', 'G2D Pango elements will be built')
		conf.env['G2D_PANGO_ELEMENTS_ENABLED'] = 1
		conf.define('WITH_G2D_PANGO_ELEMENTS', 1)
	else:
		Logs.pprint('RED', 'G2D Pango elements will not be built - pango, cairo, pangocairo packages not found')


#def build(bld):
#	if bld.env['G2D_PANGO_ELEMENTS_ENABLED']:
#		obj = bld(
#			features = ['c', bld.env['CLIBTYPE']],
#			includes = ['.', '../..'],
#			uselib = bld.env['COMMON_USELIB'] + ['PANGO', 'CAIRO', 'PANGOCAIRO', 'IMXG2D'],
#			use = ['gstimxcommon', 'gstimxblitter', 'gstimxcompositor'],
#			target = 'gstimxg2dpango',
#			source = bld.path.ant_glob('*.c'),
#			install_path = bld.env['PLUGIN_INSTALL_PATH']
#		)
